{extend name='layout/default'/}
{block name="head"}
<link href="/static/css/folder.css" rel="stylesheet">
{/block}
{block name='main'}
<div class="menuTop">
    <div class="menuTop-leftBox">
        <button class="learn-more backLast">
            <span class="circle" aria-hidden="true">
                    <span class="icon arrow"></span>
             </span>
            <span class="button-text">返回</span>
        </button>
    </div>
    <div class="menuTop-leftBox">
        {if $getConfig("uploads")==1}
        <button class="layui-btn controller-button" style="background: #46A6F8;color: #fff;width: 100%;height: 100%">
            文件上传
            <input type="file" multiple accept="image/jpeg,image/png,image/webp" id="upload"
                   style="cursor: pointer;opacity: 0;width: 100%;position: absolute;left: 0px;top: 0px;height: 100%;background: rebeccapurple">
        </button>
        {else}
        <button class="layui-btn controller-button" disabled style="background: #a6a6a6;color: #fff;width: 100%;height: 100%">
            上传服务维护中
        </button>
        {/if}
    </div>
    <div class="menuTop-leftBox" style="margin-left: 15px;background: rgba(196,217,255,0.33);user-select: none">
        <div class="menuTop-control" id="allSetting">批量操作</div>
        <div class="menuTop-control" style="display: none" id="offSetting">取消操作</div>
        <div class="menuTop-control" style="display: none" id="parseThis">粘贴文件</div>
        <div class="menuTop-control allc" style="display: none" id="selectAll">全选</div>
        <div class="menuTop-control allc" style="display: none" id="delAll">批量删除</div>
        <div class="menuTop-control allc" style="display: none" id="copyAll">批量剪切</div>
        <div class="menuTop-control allc" style="display: none" id="copyAllUrl">批量复制URL</div>
    </div>
    <div class="Space" style="width:max-content;padding:0 15px;display: flex;align-items: center;border-radius: 60px;height: 40px;margin-left:auto;box-shadow: 0 0 15px #dcdcdc;">
        <span style="margin-right: 5px">已用:{:formatSize($userinfo.use_store)}</span>/<span style="margin-left: 5px">总空间:{:formatSize($userinfo.total_store)}</span>
    </div>
</div>

{if count($list)==0}
<div style="display: flex;justify-content: center;margin-top: 100px">
    <img src="/static/images/folderEmpty.svg" class="folderIsEmpty" alt=""/>
</div>
{/if}

<div class="managerPage">
    {foreach $list as $item}
    <div class="folder-list" data-id="{$item.id}" data-url="{$item.url}">
        <label class="container-check" style="display: none">
            <input type="checkbox" class="listCheck" data-ids="{$item.id}">
            <span class="checkmark"></span>
        </label>
        <img src="{$item.murl}" class="folder-list-img" layer-src="{$item.url}" alt=""/>
        <div class="folder-list-name">
            {:mb_strlen($item.filename)>0?$item.filename:$item.id}
        </div>
    </div>
    {/foreach}
</div>

{include file='layout/paginate'/}
<div id="mouseRight">
    <ul>
        <li id="copyUrl">
            <span>复制地址</span>
            <i class="layui-icon layui-icon-triangle-r" style="right: 10px;position: absolute"></i>
            <ul class="copyChildren">
                <li data-type="url">直链</li>
                <li data-type="md">MarkDown</li>
                <li data-type="html">HTML</li>
                <li data-type="BBCode">BBCode</li>
            </ul>
        </li>
        <li id="copy">
            <span>剪切移动</span>
        </li>
        <li id="downloadFile">下载文件</li>
        <li id="removeFile">删除</li>
    </ul>
</div>

<div class="load" style="display: none;">
    <div style="font-weight: bolder;font-size: 20px;text-align: center;">上传进度</div>
    <div style="margin-top: 15px;font-size: 16px;display: flex;align-items: center;font-family: Arial, sans-serif;height: 30px">
        <div style="margin-top: 2px;letter-spacing: 2px;">
            <b id="current">1</b>/<b id="allNumber">1</b>
        </div>
        <div style="font-size: 16px;width: 180px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;margin-left: 15px" id="upName">获取中</div>
        <div style="font-size: 16px;margin-left: auto" id="upSize">0.00MB</div>
    </div>
    <div id="jd" style="margin-top: 15px">
        <div class="layui-progress layui-progress-big" lay-showPercent="true" lay-filter="filter-progress">
            <div class="layui-progress-bar layui-bg-blue" lay-percent="0%"></div>
        </div>
    </div>
</div>
<script>
    let loading = null;
    let chooseId = null
    let folder = "{$folder}";
    let page = {$page};
</script>
<script src="/static/js/folder.js"></script>
{/block}

